import config from "../config/index.js"
import {
	getToken
} from "@/utils/token.js";
export const upload = (file) => {
	return new Promise((res, rej) => {

		uni.uploadFile({
			url: config.BASE_URL + '/member/upload',
			header: {
				token: getToken()
			},
			filePath: file,
			name: 'file',
			success: (uploadFileRes) => {
				console.log(uploadFileRes.data, 14);

				res(JSON.parse(uploadFileRes.data))
			},
			fail: (err) => {
				rej(err)
			}
		});
	})
}